home *** CD-ROM | disk | FTP | other *** search
- /*
- SVEditGlobals.h
-
- Version 3.0d9
-
- Copyright © SRL Data 1992, 1993
-
- All rights reserved
-
- Produced by : SRL Data
- Originally Developed for UK.DTS
- */
-
-
- /*
- Global data structures, variables and constants for
- the 7Edit example program.
- */
-
- /** This example is brought to you for the purposes of exploration and experimentation of
- System 7.0. It is not intended to form the basis of your own programs - but try out
- the code - that's what it's there for **/
-
- /*
- About the data structures-
- SectRecord -:
- this is our own record type used for holding specific information about Publisher
- or Subscriber sections. A linked list of SectHandles is referenced from the document
- record. A SectHandle is stored in the refcon field of the Edition Manager section record- the
- same idea as hooking up the document record to the refcon of the WindowRecord.
-
- DocRec -:
- This is used for storing document records containing Font, Size and Style information.
-
- HeaderRec -:
- This is then stored as a 'TFSS' resource (standing for Text Font, Size and Style) which is
- stored in the resource fork of a document file. It also now includes stuff for storing
- the number of sections in a document and the lastsectionID
-
- New for 3.0d2 :
-
- 27-Feb-92 : NH : Add comment, zap test menu stuff,
- remove unneeded constants,
- move others to SVEditWindow.p, zap gCurrSection
-
- Changes for 3.0d4 :
-
- 3-Jul-92 : NH : Remove kAEAskUser
- Remove kAEYes,kAENo - now in AERegistry.h
- 5-Aug-92 : NH : Added SVEditAppSig, gNewDocCount
-
- Changes for 3.0d6 :
-
- 9-Sep-92 : JL : Added gRecordingImplemented flag
-
- */
-
- #ifndef __SVEDITGLOBALS__
- #define __SVEDITGLOBALS__
-
- #include <Types.h>
- #include <Quickdraw.h>
- #include <Menus.h>
- #include <Editions.h>
- #include <Printing.h>
-
- #define SVEditAppSig 'SVED'
-
- #define WindowID 128
- #define ErrorAlert 256
- #define AdviseAlert 257
-
- /*
- Menu Resource IDs
- */
-
- #define appleID 128
- #define fileID 129
- #define editID 130
- #define mfontID 131
- #define sizeID 132
- #define styleID 133
-
- #define kLastID styleID
-
- /*
- Items in Apple Menu
- */
-
- #define aboutItem 1
-
- /*
- Items in File Menu
- */
-
- #define fmNew 1
- #define fmOpen 2
- #define fmClose 4
- #define fmSave 5
- #define fmSaveAs 6
- #define fmRevert 7
- #define fmPageSetUp 9
- #define fmPrint 10
- #define fmQuit 12
-
- /*
- Items in Edit Menu
- */
- #define undoCommand 1
- #define cutCommand 3
- #define copyCommand 4
- #define pasteCommand 5
- #define clearCommand 6
- #define selectAllCommand 7
-
- #define cPublisher 9
- #define cSubscriber 10
- #define cOptions 11
- #define cBorders 12
-
- /*
- Items in Style Menu
- */
-
- #define cPlain 1
- #define cBold 2
- #define cItalic 3
- #define cUnderline 4
- #define cOutline 5
- #define cShadow 6
- #define cCondense 7
- #define cExtend 8
-
- /*
- Entry of Menu in myMenus
- */
- #define appleM 0
- #define fileM 1
- #define editM 2
- #define fontM 3
- #define sizeM 4
- #define styleM 5
- #define kLastMenu 5
-
- /*
- Save Changes Dialog Items
- */
-
- #define aaSave 1
- #define aaDiscard 2
- #define aaCancel 3
-
- #define kOSEvent app4Evt /*event used by MultiFinder*/
- #define kSuspendResumeMessage 1 /*high byte of suspend/resume event message*/
- #define kResumeMask 1 /*bit of message field for resume vs. suspend*/
- #define kMouseMovedMessage 0xFA /*high byte of mouse-moved event message*/
- #define kNoEvents 0 /*no events mask*/
-
- /*
- this is a section record to hold the information about
- the publishers and subscribers in this document
- */
-
- struct SectRec {
- SectionHandle fSectHandle;
- short fSectionID;
- RgnHandle fBorderRgn; /*handle to the outside border*/
- Rect fInnerBounds;
- short fStart; /*fStart and fEnd are both specific to a*/
- short fEnd; /*text handling application- start and end of text selection*/
- struct SectRec **fNextSection;
- FSSpec fFSSpec;
- short fCount;
- Handle fTextHandle;
- Boolean fChanged; /*has the section been changed*/
- struct DocRec *fDocument;
- };
-
- typedef struct SectRec SectRec;
- typedef SectRec *SectPtr, **SectHandle;
-
- struct DocRec {
- TEHandle theText;
- ControlHandle vScrollBar;
- ControlHandle hScrollBar;
- WindowPtr theWindow;
- Boolean dirty;
- short refNum;
- short theFont;
- short theSize;
- Style theStyle;
- Str255 theFileName;
- SectHandle firstSection; /*the first section in the list*/
- SectHandle lastSection; /*the last section*/
- short numSections;
- FSSpec theFSSpec;
- short lastID; /*the last sectionID*/
- THPrint thePrintSetup;
- Rect pageSize; /*From thePrintSetUp^^.prInfo.rPage but 0 offset*/
- Boolean showBorders;
- Boolean everSaved;
- };
-
- typedef struct DocRec DocRec;
- typedef DocRec *DPtr;
-
- struct HeaderRec {
- Str255 theFont;
- short theSize;
- Style theStyle;
- short theLength;
- short numSections;
- short lastID;
- };
-
- typedef struct HeaderRec HeaderRec;
- typedef HeaderRec *HPtr, **HHandle;
-
- #ifndef __COMPGLOBALS__
-
- extern short gWCount;
- extern short gNewDocCount;
- extern MenuHandle myMenus[kLastMenu+1];
- extern short gFontMItem;
- extern Boolean gQuitting;
- extern Cursor editCursor;
- extern Cursor waitCursor;
- extern Boolean gInBackground;
-
- /*now for the environment variables set up by Gestalt*/
-
- extern Boolean gGestaltAvailable;
- extern Boolean gAppleEventsImplemented;
- extern Boolean gAliasManagerImplemented;
- extern Boolean gEditionManagerImplemented;
- extern Boolean gOutlineFontsImplemented;
- extern Boolean gRecordingImplemented;
- #endif
-
- #endif